﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace EditFileTime
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        FileInfo file;
        private void button1_Click(object sender, EventArgs e)
        {
            OpenFileDialog openFile = new OpenFileDialog();
            DialogResult res = openFile.ShowDialog();
            if (res == DialogResult.OK)
            {
                file = new FileInfo(openFile.FileName);
                label6.Text = file.CreationTime.ToString();
                label7.Text = file.LastWriteTime.ToString();
                textBox1.Text = openFile.FileName;

            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            file.CreationTime = dateTimePicker1.Value;
            file.LastWriteTime = dateTimePicker2.Value;
            System.Diagnostics.Process.Start("explorer.exe", file.Directory.FullName);
        
        }
    }
}
